<%--
  Created by IntelliJ IDEA.
  User: 60204
  Date: 2025/4/9
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div id="main" style="width: 200px; height: 500px"></div>
<div id="max" style="width: 200px; height: 500px"></div>
</body>
<script src="../static/js/echarts.js"></script>
<script>
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        xAxis: {
            type: 'category',
            data: ${list1}
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: ${list},
                type: 'bar'
            }
        ]
    };

    option && myChart.setOption(option);
</script>
<script>
    var chartDom = document.getElementById('max');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        title: {
            text: 'World Population'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {},
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            type: 'category',
            data: ${list}
        },
        series: [
            {
                name: '2011',
                type: 'bar',
                data: ${list1}
            },
            {
                name: '2012',
                type: 'bar',
                data: ${list2}
            }
        ]
    };

    option && myChart.setOption(option);
</script>
</html>
